package com.pluto.cloud.example.web;

import com.pluto.cloud.example.dao.UserDao;
import com.pluto.cloud.example.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by Administrator on 2016/8/16.
 */
@RestController
public class UserController {

    @Autowired
    private UserDao userDao;

    @RequestMapping("/findAll")
    public List<User> findAll(){
        return userDao.findAll();
    }

    @RequestMapping("/findById/{id}")
    public User findById(@PathVariable("id") int id){
        return userDao.findById(id);
    }
}
